package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junsi.bean.ContractApprove;
import com.junsi.mapper.ContractApproveMapper;
import com.junsi.service.ContractApproveService;

@Service
public class ContractApproveServiceImpl implements ContractApproveService{
   
	@Autowired
	private ContractApproveMapper contractApproveMapper;

	@Override
	public List<ContractApprove> listAll() {
		List<ContractApprove> lsit=contractApproveMapper.listAll();
		return lsit;
	}

	@Override
	public ContractApprove findById(Integer id) {
		ContractApprove contractApprove=contractApproveMapper.findById(id);
		return contractApprove;
	}

	@Override
	public boolean insert(ContractApprove o) throws Exception {

		int result = contractApproveMapper.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean update(ContractApprove o) throws Exception {

		int result = contractApproveMapper.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean delete(Integer id) {

		int result = contractApproveMapper.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean updateAll(ContractApprove contractApprove) {
		int result = contractApproveMapper.updateAll(contractApprove);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	

}
